#coding=utf-8
from docx import Document
from docx.enum.style import WD_STYLE_TYPE

# doc = Document('test.docx')
#
# # for i in doc.tables:
# # 	for j in i.rows[1].cells:
# # 		print(j.text)
#
# # doc.tables[0].rows[1].cells[2].text = "kai'stete"
# print(doc.tables[0].rows[3].cells[0].text)
# doc.tables[0].rows[3].cells[0].text = '输入'
# doc.save('test.docx')

from docxtpl import DocxTemplate

doc = DocxTemplate("test.docx")
context = {'type1':'xukai'}
doc.render(context)

doc.save("text.docx")